CREATE SEQUENCE SEQ_CONN_API START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_API (
    API_ID NUMBER(10) DEFAULT SEQ_CONN_API.NEXTVAL NOT NULL,
    API_CODE NVARCHAR2(32) NOT NULL,
    API_NAME NVARCHAR2(64) NOT NULL,
    API_DESC NVARCHAR2(128),
    API_TYPE NCHAR(1) DEFAULT '1' NOT NULL,
    WS_OPERATION NVARCHAR2(64),
    APP_ID NVARCHAR2(32) NOT NULL,
    ALARM_SECS NUMBER(10) DEFAULT 0,
    TIMEOUT_SECS NUMBER(10) DEFAULT 0,
    RETRY_TIMES NUMBER(10) DEFAULT 0,
    API_STATUS NCHAR(1) DEFAULT '1',
    API_MASTER_VERSION NVARCHAR2(16),
    DELETE_FLAG NCHAR(1) DEFAULT 'N' NOT NULL,
    CREATE_BY NVARCHAR2(64),
    CREATE_TIME TIMESTAMP(6),
    UPDATE_BY NVARCHAR2(64),
    UPDATE_TIME TIMESTAMP(6),
    CONSTRAINT CONN_API_PKEY PRIMARY KEY (API_ID)
)
;

COMMENT ON COLUMN CONN_API.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_API.API_CODE IS 'API编码';
COMMENT ON COLUMN CONN_API.API_NAME IS 'API服务名';
COMMENT ON COLUMN CONN_API.API_DESC IS 'API描述';
COMMENT ON COLUMN CONN_API.API_TYPE IS 'API类型[1=WEBSERVICE,2=RESTFUL,3=JMS]';
COMMENT ON COLUMN CONN_API.WS_OPERATION IS 'WEBSERVICE类型方法';
COMMENT ON COLUMN CONN_API.APP_ID IS '应用系统ID';
COMMENT ON COLUMN CONN_API.ALARM_SECS IS '预警响应时间（秒）';
COMMENT ON COLUMN CONN_API.TIMEOUT_SECS IS '超时时间（秒）';
COMMENT ON COLUMN CONN_API.RETRY_TIMES IS '失败重试次数';
COMMENT ON COLUMN CONN_API.API_STATUS IS 'API状态[0=生效,1=暂存,2=停用,9=作废]';
COMMENT ON COLUMN CONN_API.API_MASTER_VERSION IS 'API主版本';
COMMENT ON COLUMN CONN_API.DELETE_FLAG IS '是否删除[Y=是,N=否]';
COMMENT ON COLUMN CONN_API.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_API.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_API.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_API.UPDATE_TIME IS '更新时间';
COMMENT ON TABLE CONN_API IS '源服务API';

CREATE SEQUENCE SEQ_CONN_API_HEADER_IN START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_API_HEADER_IN (
    HEADER_ID NUMBER(10) DEFAULT SEQ_CONN_API_HEADER_IN.NEXTVAL NOT NULL,
    API_VER_ID NUMBER(19) NOT NULL,
    API_ID NUMBER(19) NOT NULL,
    API_VERSION NVARCHAR2(16) NOT NULL,
    NODE_TYPE NVARCHAR2(16) DEFAULT 'STRING' NOT NULL,
    NODE_NAME NVARCHAR2(32) NOT NULL,
    NODE_LABEL NVARCHAR2(32) NOT NULL,
    NODE_NEEDEDABLE NCHAR(1) DEFAULT 'Y' NOT NULL,
    NODE_VALUEABLE NCHAR(1) DEFAULT 'Y' NOT NULL,
    NODE_CHECK_REGEX NVARCHAR2(128),
    CREATE_BY NVARCHAR2(64),
    CREATE_TIME TIMESTAMP(6),
    UPDATE_BY NVARCHAR2(64),
    UPDATE_TIME TIMESTAMP(6),
    CONSTRAINT CONN_API_HEADER_IN_PKEY PRIMARY KEY (HEADER_ID)
)
;

COMMENT ON COLUMN CONN_API_HEADER_IN.HEADER_ID IS '请求头主键';
COMMENT ON COLUMN CONN_API_HEADER_IN.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_API_HEADER_IN.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_API_HEADER_IN.API_VERSION IS '主版本';
COMMENT ON COLUMN CONN_API_HEADER_IN.NODE_TYPE IS '节点类型[STRING=字符串,LONG=整数,DECIMAL=小数]';
COMMENT ON COLUMN CONN_API_HEADER_IN.NODE_NAME IS '英文字段名';
COMMENT ON COLUMN CONN_API_HEADER_IN.NODE_LABEL IS '字段中文描述';
COMMENT ON COLUMN CONN_API_HEADER_IN.NODE_NEEDEDABLE IS '节点是否必须[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_HEADER_IN.NODE_VALUEABLE IS '节点是否必填[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_HEADER_IN.NODE_CHECK_REGEX IS '字段值校验正则表达式';
COMMENT ON COLUMN CONN_API_HEADER_IN.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_API_HEADER_IN.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_API_HEADER_IN.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_API_HEADER_IN.UPDATE_TIME IS '更新时间';
COMMENT ON TABLE CONN_API_HEADER_IN IS '源服务API请求头';

CREATE SEQUENCE SEQ_CONN_API_HEADER_OUT START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_API_HEADER_OUT (
    HEADER_ID NUMBER(10) DEFAULT SEQ_CONN_API_HEADER_OUT.NEXTVAL NOT NULL,
    API_VER_ID NUMBER(19),
    API_ID NUMBER(19) NOT NULL,
    API_VERSION NVARCHAR2(16),
    NODE_TYPE NVARCHAR2(16) DEFAULT 'STRING' NOT NULL,
    NODE_NAME NVARCHAR2(32) NOT NULL,
    NODE_LABEL NVARCHAR2(32),
    NODE_NEEDEDABLE NVARCHAR2(100) DEFAULT 'Y' NOT NULL,
    CREATE_BY NVARCHAR2(64),
    CREATE_TIME TIMESTAMP(6),
    UPDATE_BY NVARCHAR2(64),
    UPDATE_TIME TIMESTAMP(6),
    CONSTRAINT CONN_API_HEADER_OUT_PKEY PRIMARY KEY (HEADER_ID)
)
;

COMMENT ON COLUMN CONN_API_HEADER_OUT.HEADER_ID IS '响应头主键';
COMMENT ON COLUMN CONN_API_HEADER_OUT.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_API_HEADER_OUT.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_API_HEADER_OUT.API_VERSION IS '主版本';
COMMENT ON COLUMN CONN_API_HEADER_OUT.NODE_TYPE IS '节点类型[STRING=字符串,LONG=整数,DECIMAL=小数]';
COMMENT ON COLUMN CONN_API_HEADER_OUT.NODE_NAME IS '英文字段名';
COMMENT ON COLUMN CONN_API_HEADER_OUT.NODE_LABEL IS '字段中文描述';
COMMENT ON COLUMN CONN_API_HEADER_OUT.NODE_NEEDEDABLE IS '节点是否必须[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_HEADER_OUT.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_API_HEADER_OUT.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_API_HEADER_OUT.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_API_HEADER_OUT.UPDATE_TIME IS '更新时间';
COMMENT ON TABLE CONN_API_HEADER_OUT IS '源服务API响应头';

CREATE SEQUENCE SEQ_CONN_API_PARAM_IN START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_API_PARAM_IN (
    NODE_ID NUMBER(10) DEFAULT SEQ_CONN_API_PARAM_IN.NEXTVAL NOT NULL,
    API_VER_ID NUMBER(19),
    API_ID NUMBER(19) NOT NULL,
    API_VERSION NVARCHAR2(16),
    NODE_PARENT_ID NUMBER(19) NOT NULL,
    NODE_TYPE NVARCHAR2(8) DEFAULT 'STRING' NOT NULL,
    NODE_NAME NVARCHAR2(64) NOT NULL,
    NODE_LABEL NVARCHAR2(64),
    NODE_ALIAS NVARCHAR2(64),
    NODE_NEEDEDABLE NCHAR(1) DEFAULT 'Y' NOT NULL,
    NODE_VALUEABLE NCHAR(1) DEFAULT 'Y' NOT NULL,
    NODE_CHECK_REGEX NVARCHAR2(128),
    IS_ATTR NCHAR(1) DEFAULT 'N',
    CREATE_BY NVARCHAR2(64),
    CREATE_TIME TIMESTAMP(6),
    UPDATE_BY NVARCHAR2(64),
    UPDATE_TIME TIMESTAMP(6),
    CONSTRAINT CONN_API_PARAM_IN_PKEY PRIMARY KEY (NODE_ID)
)
;

COMMENT ON COLUMN CONN_API_PARAM_IN.NODE_ID IS '节点ID';
COMMENT ON COLUMN CONN_API_PARAM_IN.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_API_PARAM_IN.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_API_PARAM_IN.API_VERSION IS '主版本';
COMMENT ON COLUMN CONN_API_PARAM_IN.NODE_PARENT_ID IS '父节点ID';
COMMENT ON COLUMN CONN_API_PARAM_IN.NODE_TYPE IS '节点类型[STRING=字符串,LONG=整数,DECIMAL=小数,OBJECT=对象,ARRAY=数组]';
COMMENT ON COLUMN CONN_API_PARAM_IN.NODE_NAME IS '英文字段名';
COMMENT ON COLUMN CONN_API_PARAM_IN.NODE_LABEL IS '字段中文描述';
COMMENT ON COLUMN CONN_API_PARAM_IN.NODE_ALIAS IS '字段名别名（多个逗号隔开）';
COMMENT ON COLUMN CONN_API_PARAM_IN.NODE_NEEDEDABLE IS '节点是否必须[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_PARAM_IN.NODE_VALUEABLE IS '节点是否必填[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_PARAM_IN.NODE_CHECK_REGEX IS '字段值校验正则表达式';
COMMENT ON COLUMN CONN_API_PARAM_IN.IS_ATTR IS '节点是否属性[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_PARAM_IN.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_API_PARAM_IN.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_API_PARAM_IN.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_API_PARAM_IN.UPDATE_TIME IS '更新时间';
COMMENT ON TABLE CONN_API_PARAM_IN IS '源服务API入参';

CREATE SEQUENCE SEQ_CONN_API_PARAM_OUT START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_API_PARAM_OUT (
    NODE_ID NUMBER(10) DEFAULT SEQ_CONN_API_PARAM_OUT.NEXTVAL NOT NULL,
    API_VER_ID NUMBER(19),
    API_ID NUMBER(19) NOT NULL,
    API_VERSION NVARCHAR2(16),
    NODE_PARENT_ID NUMBER(19) NOT NULL,
    NODE_TYPE NVARCHAR2(8) DEFAULT 'STRING' NOT NULL,
    NODE_NAME NVARCHAR2(32) NOT NULL,
    NODE_LABEL NVARCHAR2(32),
    NODE_NEEDEDABLE NCHAR(1) DEFAULT 'Y' NOT NULL,
    IS_ATTR NCHAR(1) DEFAULT 'N',
    IS_MSG_FLAG NCHAR(1) DEFAULT 'N',
    IS_SUCCESS_FLAG NCHAR(1) DEFAULT 'N',
    SUCCESS_VALUE NVARCHAR2(8),
    CREATE_BY NVARCHAR2(64),
    CREATE_TIME TIMESTAMP(6),
    UPDATE_BY NVARCHAR2(64),
    UPDATE_TIME TIMESTAMP(6),
    CONSTRAINT CONN_API_PARAM_OUT_PKEY PRIMARY KEY (NODE_ID)
)
;

COMMENT ON COLUMN CONN_API_PARAM_OUT.NODE_ID IS '节点ID';
COMMENT ON COLUMN CONN_API_PARAM_OUT.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_API_PARAM_OUT.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_API_PARAM_OUT.API_VERSION IS '主版本';
COMMENT ON COLUMN CONN_API_PARAM_OUT.NODE_PARENT_ID IS '父节点ID';
COMMENT ON COLUMN CONN_API_PARAM_OUT.NODE_TYPE IS '节点类型[STRING=字符串,LONG=整数,DECIMAL=小数,OBJECT=对象,ARRAY=数组]';
COMMENT ON COLUMN CONN_API_PARAM_OUT.NODE_NAME IS '英文字段名';
COMMENT ON COLUMN CONN_API_PARAM_OUT.NODE_LABEL IS '字段中文描述';
COMMENT ON COLUMN CONN_API_PARAM_OUT.NODE_NEEDEDABLE IS '节点是否必须[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_PARAM_OUT.IS_ATTR IS '节点是否属性[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_PARAM_OUT.IS_MSG_FLAG IS '是否消息标识[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_PARAM_OUT.IS_SUCCESS_FLAG IS '是否成功标识[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_PARAM_OUT.SUCCESS_VALUE IS '成功的值';
COMMENT ON COLUMN CONN_API_PARAM_OUT.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_API_PARAM_OUT.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_API_PARAM_OUT.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_API_PARAM_OUT.UPDATE_TIME IS '更新时间';
COMMENT ON TABLE CONN_API_PARAM_OUT IS '源服务API出参';

CREATE SEQUENCE SEQ_CONN_API_VERSION START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_API_VERSION (
    API_VER_ID NUMBER(10) DEFAULT SEQ_CONN_API_VERSION.NEXTVAL NOT NULL,
    API_ID NUMBER(19) NOT NULL,
    API_VERSION NVARCHAR2(16),
    API_URL NVARCHAR2(512),
    HTTP_REQUEST_METHOD NVARCHAR2(8),
    API_PARAMS_BODY NCHAR(1) DEFAULT '1',
    INPARAM_WITH_ATTR NCHAR(1) DEFAULT 'N' NOT NULL,
    OUTPARAM_WITH_ATTR NCHAR(1) DEFAULT 'N' NOT NULL,
    API_VER_DESC NVARCHAR2(512),
    API_VER_STATUS NCHAR(1) DEFAULT '0',
    API_VER_START_TIME TIMESTAMP(6),
    API_VER_END_TIME TIMESTAMP(6),
    WSDL_CONTENT_ID NUMBER(19),
    WS_OPERATION NVARCHAR2(64),
    WSDL_URL_ORIGIN NCHAR(1) DEFAULT 'Y',
    JMS_DATASOURCE_CODE NVARCHAR2(32),
    JMS_TYPE NVARCHAR2(16),
    JMS_DESTINATION_NAME NVARCHAR2(64),
    JMS_ROLE NCHAR(1) DEFAULT 'C',
    CREATE_BY NVARCHAR2(64),
    CREATE_TIME TIMESTAMP(6),
    UPDATE_BY NVARCHAR2(64),
    UPDATE_TIME TIMESTAMP(6),
    CONSTRAINT CONN_API_VERSION_PKEY PRIMARY KEY (API_VER_ID)
)
;

COMMENT ON COLUMN CONN_API_VERSION.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_API_VERSION.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_API_VERSION.API_VERSION IS 'API版本';
COMMENT ON COLUMN CONN_API_VERSION.API_URL IS 'API服务URL';
COMMENT ON COLUMN CONN_API_VERSION.HTTP_REQUEST_METHOD IS 'API请求方式[GET=GET,POST=POST]';
COMMENT ON COLUMN CONN_API_VERSION.API_PARAMS_BODY IS '参数体类型[1=RAW,2=FORMDATA]';
COMMENT ON COLUMN CONN_API_VERSION.INPARAM_WITH_ATTR IS '带属性入参[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_VERSION.OUTPARAM_WITH_ATTR IS '带属性出参[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_VERSION.API_VER_DESC IS 'API版本说明';
COMMENT ON COLUMN CONN_API_VERSION.API_VER_STATUS IS 'API版本状态[0=生效,1=暂存,2=停用,9=作废]';
COMMENT ON COLUMN CONN_API_VERSION.API_VER_START_TIME IS '版本启用时间';
COMMENT ON COLUMN CONN_API_VERSION.API_VER_END_TIME IS '版本停用时间（根据启停时间定时更新版本状态）';
COMMENT ON COLUMN CONN_API_VERSION.WSDL_CONTENT_ID IS 'WSDL内容主键';
COMMENT ON COLUMN CONN_API_VERSION.WS_OPERATION IS 'WEBSERVICE类型方法';
COMMENT ON COLUMN CONN_API_VERSION.WSDL_URL_ORIGIN IS 'WSDL来源URL[Y=是,N=否]';
COMMENT ON COLUMN CONN_API_VERSION.JMS_DATASOURCE_CODE IS 'JMS数据源编码';
COMMENT ON COLUMN CONN_API_VERSION.JMS_TYPE IS 'JMS类型[TOPIC=TOPIC,QUEUE=QUEUE]';
COMMENT ON COLUMN CONN_API_VERSION.JMS_DESTINATION_NAME IS 'JMS消息目标名称';
COMMENT ON COLUMN CONN_API_VERSION.JMS_ROLE IS 'JMS角色[P=生产者,C=消费者]';
COMMENT ON COLUMN CONN_API_VERSION.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_API_VERSION.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_API_VERSION.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_API_VERSION.UPDATE_TIME IS '更新时间';
COMMENT ON TABLE CONN_API_VERSION IS '源服务API版本';

CREATE SEQUENCE SEQ_CONN_APP_SIGN_SERVICE START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_APP_SIGN_SERVICE (
    SIGN_ID NUMBER(19) NOT NULL, -- 签约ID
    APP_ID NVARCHAR2(32) NOT NULL, -- 应用系统ID
    SERVICE_ID NUMBER(19) NOT NULL, -- 服务ID
    ORDER_EXPLAIN NVARCHAR2(512) DEFAULT '', -- 订购说明
    SIGN_STATUS NCHAR(1) DEFAULT '0' NOT NULL, -- 签约状态[0=生效,1=暂存,2=停用,7=驳回,8=审批中,9=作废]
    SERVICE_START_TIME TIMESTAMP(6) NULL, -- 生效时间
    SERVICE_END_TIME TIMESTAMP(6) NULL, -- 过期时间（根据时间定时更新签约状态）
    SERVICE_VERSION NVARCHAR2(16) DEFAULT '', -- 签约服务版本（能力服务升级时需手动选择升级版本）
    CREATE_BY NVARCHAR2(64) DEFAULT '', -- 创建者
    CREATE_TIME TIMESTAMP(6) NULL, -- 创建时间
    UPDATE_BY NVARCHAR2(64) DEFAULT '', -- 更新者
    UPDATE_TIME TIMESTAMP(6) NULL, -- 更新时间
    CONSTRAINT CONN_APP_SIGN_SERVICE_PKEY PRIMARY KEY (SIGN_ID)
);
COMMENT ON TABLE CONN_APP_SIGN_SERVICE IS '应用签约能力服务';

COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.SIGN_ID IS '签约ID';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.APP_ID IS '应用系统ID';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.SERVICE_ID IS '服务ID';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.ORDER_EXPLAIN IS '订购说明';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.SIGN_STATUS IS '签约状态[0=生效,1=暂存,2=停用,7=驳回,8=审批中,9=作废]';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.SERVICE_START_TIME IS '生效时间';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.SERVICE_END_TIME IS '过期时间（根据时间定时更新签约状态）';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.SERVICE_VERSION IS '签约服务版本（能力服务升级时需手动选择升级版本）';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_APP_SIGN_SERVICE.UPDATE_TIME IS '更新时间';

CREATE SEQUENCE SEQ_CONN_CHANGE_HEADER_IN START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_CHANGE_HEADER_IN (
    CHANGE_ID NUMBER(19) NOT NULL, -- 唯一标准
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    API_HEADER_ID NUMBER(19) NOT NULL, -- API请求头主键
    API_VER_ID NUMBER(19) NOT NULL, -- API版本主键
    JSON_PATH NVARCHAR2(128) DEFAULT '', -- 映射请求JSONPATH路径
    CONSTRAINT CONN_CHANGE_HEADER_IN_PKEY PRIMARY KEY (CHANGE_ID)
);
COMMENT ON TABLE CONN_CHANGE_HEADER_IN IS '能力服务与API请求参数结构转换';

COMMENT ON COLUMN CONN_CHANGE_HEADER_IN.CHANGE_ID IS '唯一标准';
COMMENT ON COLUMN CONN_CHANGE_HEADER_IN.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_CHANGE_HEADER_IN.API_HEADER_ID IS 'API请求头主键';
COMMENT ON COLUMN CONN_CHANGE_HEADER_IN.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_CHANGE_HEADER_IN.JSON_PATH IS '映射请求JSONPATH路径';

CREATE SEQUENCE SEQ_CONN_CHANGE_HEADER_OUT START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_CHANGE_HEADER_OUT (
    CHANGE_ID NUMBER(19) NOT NULL, -- 唯一标准
    SERVICE_HEADER_ID NUMBER(19) NOT NULL, -- 服务响应头主键
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    API_VER_ID NUMBER(19) NOT NULL, -- API版本主键
    JSON_PATH NVARCHAR2(128) DEFAULT '', -- 映射请求JSONPATH路径
    CONSTRAINT CONN_CHANGE_HEADER_OUT_PKEY PRIMARY KEY (CHANGE_ID)
);
COMMENT ON TABLE CONN_CHANGE_HEADER_OUT IS 'API与能力服务响应参数结构转换';

COMMENT ON COLUMN CONN_CHANGE_HEADER_OUT.CHANGE_ID IS '唯一标准';
COMMENT ON COLUMN CONN_CHANGE_HEADER_OUT.SERVICE_HEADER_ID IS '服务响应头主键';
COMMENT ON COLUMN CONN_CHANGE_HEADER_OUT.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_CHANGE_HEADER_OUT.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_CHANGE_HEADER_OUT.JSON_PATH IS '映射请求JSONPATH路径';

CREATE SEQUENCE SEQ_CONN_CHANGE_PARAM_IN START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_CHANGE_PARAM_IN (
    CHANGE_ID NUMBER(19) NOT NULL, -- 唯一标准
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    API_NODE_ID NUMBER(19) NOT NULL, -- API节点ID
    API_VER_ID NUMBER(19) NOT NULL, -- API版本主键
    JSON_PATH NVARCHAR2(128) DEFAULT '', -- 映射请求JSONPATH路径
    CONSTRAINT CONN_CHANGE_PARAM_IN_PKEY PRIMARY KEY (CHANGE_ID)
);
COMMENT ON TABLE CONN_CHANGE_PARAM_IN IS '能力服务与API入参结构转换';

COMMENT ON COLUMN CONN_CHANGE_PARAM_IN.CHANGE_ID IS '唯一标准';
COMMENT ON COLUMN CONN_CHANGE_PARAM_IN.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_CHANGE_PARAM_IN.API_NODE_ID IS 'API节点ID';
COMMENT ON COLUMN CONN_CHANGE_PARAM_IN.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_CHANGE_PARAM_IN.JSON_PATH IS '映射请求JSONPATH路径';

CREATE SEQUENCE SEQ_CONN_CHANGE_PARAM_OUT START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_CHANGE_PARAM_OUT (
    CHANGE_ID NUMBER(19) NOT NULL, -- 唯一标准
    SERVICE_NODE_ID NUMBER(19) NOT NULL, -- 服务节点ID
    SERVICE_VER_ID NUMBER(19) NULL, -- 服务版本主键
    API_VER_ID NUMBER(19) NOT NULL, -- API版本主键
    JSON_PATH NVARCHAR2(128) DEFAULT '', -- 映射请求JSONPATH路径
    CONSTRAINT CONN_CHANGE_PARAM_OUT_PKEY PRIMARY KEY (CHANGE_ID)
);
COMMENT ON TABLE CONN_CHANGE_PARAM_OUT IS 'API与能力服务输出参数结构转换';

COMMENT ON COLUMN CONN_CHANGE_PARAM_OUT.CHANGE_ID IS '唯一标准';
COMMENT ON COLUMN CONN_CHANGE_PARAM_OUT.SERVICE_NODE_ID IS '服务节点ID';
COMMENT ON COLUMN CONN_CHANGE_PARAM_OUT.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_CHANGE_PARAM_OUT.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_CHANGE_PARAM_OUT.JSON_PATH IS '映射请求JSONPATH路径';

CREATE SEQUENCE SEQ_CONN_CONTENT START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_CONTENT (
    CONTENT_ID NUMBER(19) NOT NULL, -- 内容主键
    CONTENT_TEXT NCLOB NOT NULL, -- 内容
    CONTENT_TYPE NVARCHAR2(8) NOT NULL, -- 内容类型[ROUTE=路由,WSDL=WSDL,ORCHES=编排]
    MD5 NVARCHAR2(32) NULL, -- MD5值
    CONSTRAINT CONN_CONTENT_PKEY PRIMARY KEY (CONTENT_ID)
);
COMMENT ON TABLE CONN_CONTENT IS '内容表';

COMMENT ON COLUMN CONN_CONTENT.CONTENT_ID IS '内容主键';
COMMENT ON COLUMN CONN_CONTENT.CONTENT_TEXT IS '内容';
COMMENT ON COLUMN CONN_CONTENT.CONTENT_TYPE IS '内容类型[ROUTE=路由,WSDL=WSDL,ORCHES=编排]';
COMMENT ON COLUMN CONN_CONTENT.MD5 IS 'MD5值';

CREATE TABLE CONN_JMS_DATASOURCE (
    JMS_CODE NVARCHAR2(32) NOT NULL, -- JMS数据源编码
    JMS_NAME NVARCHAR2(32) NOT NULL, -- JMS数据源名称
    JMS_DESC NVARCHAR2(128) DEFAULT '', -- JMS数据源描述
    JMS_HOST NVARCHAR2(64) NOT NULL, -- 主机地址
    JMS_PORT NUMBER(10) NOT NULL, -- 端口号
    JMS_USERNAME NVARCHAR2(128) DEFAULT '', -- 用户名
    JMS_PASSWORD NVARCHAR2(128) DEFAULT '', -- 密码
    IS_ENABLE NCHAR(1) DEFAULT 'Y' NOT NULL, -- 是否启用[Y=启用,N=禁用]
    CREATE_BY NVARCHAR2(64) DEFAULT '', -- 创建人
    CREATE_TIME TIMESTAMP(6) NULL, -- 创建时间
    UPDATE_BY NVARCHAR2(64) DEFAULT '', -- 更新人
    UPDATE_TIME TIMESTAMP(6) NULL, -- 更新时间
    REMARK NVARCHAR2(256) DEFAULT '', -- 备注
    CONSTRAINT CONN_JMS_DATASOURCE_PKEY PRIMARY KEY (JMS_CODE)
);
COMMENT ON TABLE CONN_JMS_DATASOURCE IS 'JMS数据源';

COMMENT ON COLUMN CONN_JMS_DATASOURCE.JMS_CODE IS 'JMS数据源编码';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.JMS_NAME IS 'JMS数据源名称';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.JMS_DESC IS 'JMS数据源描述';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.JMS_HOST IS '主机地址';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.JMS_PORT IS '端口号';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.JMS_USERNAME IS '用户名';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.JMS_PASSWORD IS '密码';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.IS_ENABLE IS '是否启用[Y=启用,N=禁用]';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.CREATE_BY IS '创建人';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.UPDATE_BY IS '更新人';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.UPDATE_TIME IS '更新时间';
COMMENT ON COLUMN CONN_JMS_DATASOURCE.REMARK IS '备注';

CREATE SEQUENCE SEQ_CONN_NORTH_INTF_LOG START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_NORTH_INTF_LOG (
    NORTH_INTF_LOG_ID NUMBER(19) NOT NULL, -- 主键ID
    SERVICE_CODE NVARCHAR2(64) NULL, -- 接口编码
    BIZ_CODE NVARCHAR2(64) NULL, -- 业务编码
    WS_METHOD_NAME NVARCHAR2(64) NULL, -- WEBSERVICE方法名
    NORTH_IN_PARAMS NCLOB NULL, -- 北向发送的接口参数
    PRODUCER_RETRUN_MSG NCLOB NULL, -- 开放互联生产者接口返回的信息
    STATUS NCHAR(1) DEFAULT '0' NULL, -- 状态[0=已接收,1=已发送,2=下发成功,3=下发失败]
    NUM NUMBER(10) NULL, -- 重推次数
    OUT_PARAMS NCLOB NULL, -- 开放互联消费者转换后下发的参数
    JS_RETRUN_MSG NCLOB NULL, -- 江苏综调接口返回的信息
    NORTH_TIME TIMESTAMP(6) NULL, -- 北向调用接口平台时间
    INVOKE_JS_TIME TIMESTAMP(6) NULL, -- 接口平台调用江苏综调系统接口时间
    INVOKE_MODE NCHAR(1) DEFAULT '3' NULL, -- 调用方式[1=透传,3=转换]
    ERROR_MSG NCLOB NULL, -- 错误信息
    CONSTRAINT CONN_NORTH_INTF_LOG_PKEY PRIMARY KEY (NORTH_INTF_LOG_ID)
);
COMMENT ON TABLE CONN_NORTH_INTF_LOG IS '北向调用：接口日志表';

COMMENT ON COLUMN CONN_NORTH_INTF_LOG.NORTH_INTF_LOG_ID IS '主键ID';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.SERVICE_CODE IS '接口编码';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.BIZ_CODE IS '业务编码';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.WS_METHOD_NAME IS 'WEBSERVICE方法名';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.NORTH_IN_PARAMS IS '北向发送的接口参数';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.PRODUCER_RETRUN_MSG IS '开放互联生产者接口返回的信息';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.STATUS IS '状态[0=已接收,1=已发送,2=下发成功,3=下发失败]';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.NUM IS '重推次数';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.OUT_PARAMS IS '开放互联消费者转换后下发的参数';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.JS_RETRUN_MSG IS '江苏综调接口返回的信息';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.NORTH_TIME IS '北向调用接口平台时间';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.INVOKE_JS_TIME IS '接口平台调用江苏综调系统接口时间';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.INVOKE_MODE IS '调用方式[1=透传,3=转换]';
COMMENT ON COLUMN CONN_NORTH_INTF_LOG.ERROR_MSG IS '错误信息';

CREATE SEQUENCE SEQ_CONN_PARAM_MAP_IN START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_PARAM_MAP_IN (
    MAP_ID NUMBER(19) NOT NULL, -- 映射ID
    SERVICE_NODE_ID NUMBER(19) NOT NULL, -- 服务节点ID
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    SERVICE_ID NUMBER(19) NOT NULL, -- 服务ID
    SERVICE_VERSION NVARCHAR2(16) DEFAULT '' NOT NULL, -- 服务版本
    SERVICE_NODE_NAME NVARCHAR2(32) DEFAULT '' NOT NULL, -- 服务节点英文名
    API_NODE_ID NUMBER(19) NOT NULL, -- API节点ID
    API_VER_ID NUMBER(19) NOT NULL, -- API版本主键
    API_ID NUMBER(19) NOT NULL, -- API主键
    API_VERSION NVARCHAR2(16) DEFAULT '' NOT NULL, -- 主版本
    API_NODE_ISHIDED NCHAR(1) DEFAULT 'N' NOT NULL, -- 是否隐藏[Y=是,N=否]
    CONSTRAINT CONN_PARAM_MAP_IN_PKEY PRIMARY KEY (MAP_ID)
);
COMMENT ON TABLE CONN_PARAM_MAP_IN IS '能力服务与API入参映射（记录API和SERVICE中全部节点）';

COMMENT ON COLUMN CONN_PARAM_MAP_IN.MAP_ID IS '映射ID';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.SERVICE_NODE_ID IS '服务节点ID';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.SERVICE_ID IS '服务ID';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.SERVICE_VERSION IS '服务版本';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.SERVICE_NODE_NAME IS '服务节点英文名';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.API_NODE_ID IS 'API节点ID';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.API_VERSION IS '主版本';
COMMENT ON COLUMN CONN_PARAM_MAP_IN.API_NODE_ISHIDED IS '是否隐藏[Y=是,N=否]';

CREATE SEQUENCE SEQ_CONN_PARAM_MAP_OUT START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_PARAM_MAP_OUT (
    MAP_ID NUMBER(19) NOT NULL, -- 映射ID
    SERVICE_NODE_ID NUMBER(19) NOT NULL, -- 服务节点ID
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    SERVICE_ID NUMBER(19) NOT NULL, -- 服务ID
    SERVICE_VERSION NVARCHAR2(16) DEFAULT '' NOT NULL, -- 服务版本
    SERVICE_NODE_NAME NVARCHAR2(32) DEFAULT '' NOT NULL, -- 服务节点英文名
    API_NODE_ID NUMBER(19) NULL, -- API节点ID（计算生成的新字段为空）
    API_VER_ID NUMBER(19) NOT NULL, -- API版本主键
    API_ID NUMBER(19) NOT NULL, -- API主键
    API_VERSION NVARCHAR2(16) DEFAULT '' NOT NULL, -- 主版本
    API_FIELD_EXPRESSION NVARCHAR2(128) DEFAULT '', -- API字段运算表达式
    API_NODE_ISHIDED NCHAR(1) DEFAULT 'N' NOT NULL, -- 是否隐藏[Y=是,N=否]
    CONSTRAINT CONN_PARAM_MAP_OUT_PKEY PRIMARY KEY (MAP_ID)
);
COMMENT ON TABLE CONN_PARAM_MAP_OUT IS '能力服务与API出参映射（记录API和SERVICE中全部节点）';

COMMENT ON COLUMN CONN_PARAM_MAP_OUT.MAP_ID IS '映射ID';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.SERVICE_NODE_ID IS '服务节点ID';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.SERVICE_ID IS '服务ID';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.SERVICE_VERSION IS '服务版本';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.SERVICE_NODE_NAME IS '服务节点英文名';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.API_NODE_ID IS 'API节点ID（计算生成的新字段为空）';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.API_VERSION IS '主版本';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.API_FIELD_EXPRESSION IS 'API字段运算表达式';
COMMENT ON COLUMN CONN_PARAM_MAP_OUT.API_NODE_ISHIDED IS '是否隐藏[Y=是,N=否]';

CREATE SEQUENCE SEQ_CONN_SCRIPT START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_SCRIPT (
    ID NUMBER(19) NOT NULL, -- 主键
    APP_ID NVARCHAR2(64) NULL, -- 应用ID
    SCRIPT_CONTEXT NCLOB NULL, -- 脚本内容
    SCRIPT_PACKAGE_NAME NVARCHAR2(255) NULL, -- 脚本包名
    SCRIPT_CLASS_NAME NVARCHAR2(255) NULL, -- 脚本类名
    MAIN_METHOD NVARCHAR2(255) NULL, -- 脚本入口函数
    CONN_CONTENT_ID NCLOB NULL, -- 路由内容表ID
    SCRIPT_TYPE NUMBER(10) NULL, -- 脚本类型1JAVA2SCRIPT3PYTHON
    IS_DELETED NUMBER(10) NULL, -- 是否删除
    CREATE_BY NVARCHAR2(255) NULL, -- 创建者
    CREATE_TIME TIMESTAMP(6) NULL, -- 创建时间
    UPDATE_BY NVARCHAR2(255) NULL, -- 修改者
    UPDATE_TIME TIMESTAMP(6) NULL, -- 修改时间
    CONSTRAINT CONN_SCRIPT_PKEY PRIMARY KEY (ID)
);
CREATE INDEX APP_ID_INDEX ON CONN_SCRIPT(APP_ID);
CREATE INDEX IS_DELETED_INDEX ON CONN_SCRIPT(IS_DELETED);
CREATE INDEX PACKAGE_NAME_AND_CLASS_INDEX ON CONN_SCRIPT(SCRIPT_PACKAGE_NAME, SCRIPT_CLASS_NAME);
CREATE INDEX SCRIPT_TYPE_INDEX ON CONN_SCRIPT(SCRIPT_TYPE);

COMMENT ON COLUMN CONN_SCRIPT.ID IS '主键';
COMMENT ON COLUMN CONN_SCRIPT.APP_ID IS '应用ID';
COMMENT ON COLUMN CONN_SCRIPT.SCRIPT_CONTEXT IS '脚本内容';
COMMENT ON COLUMN CONN_SCRIPT.SCRIPT_PACKAGE_NAME IS '脚本包名';
COMMENT ON COLUMN CONN_SCRIPT.SCRIPT_CLASS_NAME IS '脚本类名';
COMMENT ON COLUMN CONN_SCRIPT.MAIN_METHOD IS '脚本入口函数';
COMMENT ON COLUMN CONN_SCRIPT.CONN_CONTENT_ID IS '路由内容表ID';
COMMENT ON COLUMN CONN_SCRIPT.SCRIPT_TYPE IS '脚本类型1JAVA2SCRIPT3PYTHON';
COMMENT ON COLUMN CONN_SCRIPT.IS_DELETED IS '是否删除';
COMMENT ON COLUMN CONN_SCRIPT.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_SCRIPT.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_SCRIPT.UPDATE_BY IS '修改者';
COMMENT ON COLUMN CONN_SCRIPT.UPDATE_TIME IS '修改时间';

CREATE TABLE CONN_SERV_TYPE_DATASET (
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    DATASET_ID NUMBER(19) NOT NULL, -- 数据集ID
    CONSTRAINT CONN_SERV_TYPE_DATASET_PKEY PRIMARY KEY (SERVICE_VER_ID)
);
COMMENT ON TABLE CONN_SERV_TYPE_DATASET IS '能力服务数据接口';

COMMENT ON COLUMN CONN_SERV_TYPE_DATASET.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERV_TYPE_DATASET.DATASET_ID IS '数据集ID';

CREATE TABLE CONN_SERV_TYPE_DIRECT (
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    API_VER_ID NUMBER(19) NULL, -- API版本主键
    API_ID NUMBER(19) NOT NULL, -- API主键
    API_VERSION NVARCHAR2(16) DEFAULT '', -- 主版本
    CONSTRAINT CONN_SERV_TYPE_DIRECT_PKEY PRIMARY KEY (SERVICE_VER_ID)
);
COMMENT ON TABLE CONN_SERV_TYPE_DIRECT IS '能力服务直连接口';

COMMENT ON COLUMN CONN_SERV_TYPE_DIRECT.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERV_TYPE_DIRECT.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_SERV_TYPE_DIRECT.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_SERV_TYPE_DIRECT.API_VERSION IS '主版本';

CREATE TABLE CONN_SERV_TYPE_EXPERT (
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    EXPERT_DSL_CONTENT_ID NUMBER(19) NOT NULL, -- CAMEL编排DSL内容ID
    CONSTRAINT CONN_SERV_TYPE_EXPERT_PKEY PRIMARY KEY (SERVICE_VER_ID)
);
COMMENT ON TABLE CONN_SERV_TYPE_EXPERT IS '能力专家模式接口';

COMMENT ON COLUMN CONN_SERV_TYPE_EXPERT.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERV_TYPE_EXPERT.EXPERT_DSL_CONTENT_ID IS 'CAMEL编排DSL内容ID';

CREATE TABLE CONN_SERV_TYPE_ORCHESTRATION (
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    ORCHESTRATION_DSL_CONTENT_ID NUMBER(19) NOT NULL, -- CAMEL编排DSL内容ID
    CONSTRAINT CONN_SERV_TYPE_ORCHESTRATION_PKEY PRIMARY KEY (SERVICE_VER_ID)
);
COMMENT ON TABLE CONN_SERV_TYPE_ORCHESTRATION IS '能力服务编排接口';

COMMENT ON COLUMN CONN_SERV_TYPE_ORCHESTRATION.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERV_TYPE_ORCHESTRATION.ORCHESTRATION_DSL_CONTENT_ID IS 'CAMEL编排DSL内容ID';

CREATE TABLE CONN_SERV_TYPE_PROTOCOL (
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    API_VER_ID NUMBER(19) NULL, -- API版本主键
    API_ID NUMBER(19) NOT NULL, -- API主键
    API_VERSION NVARCHAR2(16) DEFAULT '', -- 主版本
    IS_PARAM_SERIALIZE NCHAR(1) DEFAULT 'N' NULL, -- 出入参序列化[Y=是,N=否]
    IS_PARAM_IN_SERIALIZE NCHAR(1) DEFAULT 'N' NULL, -- 入参序列化[Y=是,N=否]
    IS_PARAM_OUT_SERIALIZE NCHAR(1) DEFAULT 'N' NULL, -- 出参序列化[Y=是,N=否]
    PARAM_SERIALIZE_TYPE NCHAR(1) DEFAULT '1' NULL, -- 出入参序列化类型[1=XML,2=JSON]
    PARAM_IN_SERIALIZE_TYPE NCHAR(1) DEFAULT '' NULL, -- 入参序列化类型[1=XML,2=JSON]
    PARAM_OUT_SERIALIZE_TYPE NCHAR(1) DEFAULT '' NULL, -- 出参序列化类型[1=XML,2=JSON]
    PARAM_IN_SERIALIZE_NAME NVARCHAR2(32) DEFAULT '', -- 入参序列化名称
    PARAM_OUT_SERIALIZE_NAME NVARCHAR2(32) DEFAULT '', -- 出参序列化名称
    IS_HEADER_IN_CHANGE NCHAR(1) DEFAULT 'N' NULL, -- 请求头结构转换[Y=是,N=否]
    IS_HEADER_OUT_CHANGE NCHAR(1) DEFAULT 'N' NULL, -- 响应头结构转换[Y=是,N=否]
    IS_PARAM_IN_CHANGE NCHAR(1) DEFAULT 'N' NULL, -- 输入参数结构转换[Y=是,N=否]
    IS_PARAM_OUT_CHANGE NCHAR(1) DEFAULT 'N' NULL, -- 输出参数结构转换[Y=是,N=否]
    CONSTRAINT CONN_SERV_TYPE_PROTOCOL_PKEY PRIMARY KEY (SERVICE_VER_ID)
);
COMMENT ON TABLE CONN_SERV_TYPE_PROTOCOL IS '能力服务协议转换接口（包含结构和协议转换）';

COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.API_VER_ID IS 'API版本主键';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.API_ID IS 'API主键';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.API_VERSION IS '主版本';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.IS_PARAM_SERIALIZE IS '出入参序列化[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.IS_PARAM_IN_SERIALIZE IS '入参序列化[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.IS_PARAM_OUT_SERIALIZE IS '出参序列化[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.PARAM_SERIALIZE_TYPE IS '出入参序列化类型[1=XML,2=JSON]';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.PARAM_IN_SERIALIZE_TYPE IS '入参序列化类型[1=XML,2=JSON]';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.PARAM_OUT_SERIALIZE_TYPE IS '出参序列化类型[1=XML,2=JSON]';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.PARAM_IN_SERIALIZE_NAME IS '入参序列化名称';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.PARAM_OUT_SERIALIZE_NAME IS '出参序列化名称';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.IS_HEADER_IN_CHANGE IS '请求头结构转换[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.IS_HEADER_OUT_CHANGE IS '响应头结构转换[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.IS_PARAM_IN_CHANGE IS '输入参数结构转换[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERV_TYPE_PROTOCOL.IS_PARAM_OUT_CHANGE IS '输出参数结构转换[Y=是,N=否]';

CREATE TABLE CONN_SERV_TYPE_SCRIPT (
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    SCRIPT_ID NUMBER(19) NOT NULL, -- 脚本主键ID
    CONSTRAINT CONN_SERV_TYPE_SCRIPT_PKEY PRIMARY KEY (SERVICE_VER_ID)
);
CREATE INDEX SCRIPT_ID_INDEX ON CONN_SERV_TYPE_SCRIPT(SCRIPT_ID);
COMMENT ON TABLE CONN_SERV_TYPE_SCRIPT IS '能力服务脚本接口';

COMMENT ON COLUMN CONN_SERV_TYPE_SCRIPT.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERV_TYPE_SCRIPT.SCRIPT_ID IS '脚本主键ID';

CREATE SEQUENCE SEQ_CONN_SERVICE START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_SERVICE (
    SERVICE_ID NUMBER(19) NOT NULL, -- 服务ID
    SERVICE_CODE NVARCHAR2(32) NOT NULL, -- 能力服务编码
    SERVICE_NAME NVARCHAR2(64) NOT NULL, -- 能力服务名
    SERVICE_PATH NVARCHAR2(64) DEFAULT '' NOT NULL, -- 服务请求短路径
    CATE_ID NUMBER(19) NOT NULL, -- 分类ID
    SERVICE_DESC NVARCHAR2(128) DEFAULT '', -- 描述
    SERVICE_TYPE NCHAR(1) DEFAULT '1' NULL, -- 能力类型[1=WEBSERVICE,2=RESTFUL,3=JMS]
    SERVER_RELEASE_TYPE NCHAR(1) NULL, -- 能力注册方式[1=API直连,2=复合编排,3=协议转换,4=数据接口,9=专家模式]
    MOCK_URL NVARCHAR2(512) DEFAULT '', -- MOCK服务URL
    MOCK_ENDPOINT NVARCHAR2(64) DEFAULT '', -- MOCK服务ENDPOINT
    MOCK_SERVICE_NAME NVARCHAR2(64) DEFAULT '', -- MOCK服务SERVICENAME
    MOCK_PORT_NAME NVARCHAR2(64) DEFAULT '', -- MOCK服务PORTNAME
    MOCK_OPERATION NVARCHAR2(64) DEFAULT '', -- MOCK服务METHOD
    LIMIT_CTRL_STATUS NCHAR(1) DEFAULT '1' NULL, -- 限流开关[0=正常,2=停用]
    LIMIT_CTRL_TYPE NCHAR(1) DEFAULT '1' NULL, -- 限流方式[1=QPS,2=线程数]
    LIMIT_CTRL_PARAMVAL NUMBER(10) DEFAULT 100 NULL, -- 限流阀值
    ALARM_SECS NUMBER(10) DEFAULT 0 NULL, -- 预警响应时间（秒）
    TIMEOUT_SECS NUMBER(10) DEFAULT 0 NULL, -- 超时时间（秒）
    SERVICE_STATUS NCHAR(1) DEFAULT '1' NULL, -- 服务状态[0=生效,1=暂存,2=停用,7=驳回,8=审批中,9=作废]
    SERVICE_MASTER_VERSION NVARCHAR2(16) DEFAULT '', -- 服务主版本
    DELETE_FLAG NCHAR(1) DEFAULT 'N' NOT NULL, -- 是否删除[Y=是,N=否]
    CREATE_BY NVARCHAR2(64) NULL, -- 创建者
    CREATE_TIME TIMESTAMP(6) NULL, -- 创建时间
    UPDATE_BY NVARCHAR2(64) DEFAULT '', -- 更新者
    UPDATE_TIME TIMESTAMP(6) NULL, -- 更新时间
    ROUTE_CONTENT_ID NUMBER(19) NULL, -- 路由内容主键
    CONSTRAINT CONN_SERVICE_PKEY PRIMARY KEY (SERVICE_ID)
);
CREATE INDEX IDX_CONN_SERVICE ON CONN_SERVICE(SERVICE_CODE);
COMMENT ON TABLE CONN_SERVICE IS '能力服务接口';

COMMENT ON COLUMN CONN_SERVICE.SERVICE_ID IS '服务ID';
COMMENT ON COLUMN CONN_SERVICE.SERVICE_CODE IS '能力服务编码';
COMMENT ON COLUMN CONN_SERVICE.SERVICE_NAME IS '能力服务名';
COMMENT ON COLUMN CONN_SERVICE.SERVICE_PATH IS '服务请求短路径';
COMMENT ON COLUMN CONN_SERVICE.CATE_ID IS '分类ID';
COMMENT ON COLUMN CONN_SERVICE.SERVICE_DESC IS '描述';
COMMENT ON COLUMN CONN_SERVICE.SERVICE_TYPE IS '能力类型[1=WEBSERVICE,2=RESTFUL,3=JMS]';
COMMENT ON COLUMN CONN_SERVICE.SERVER_RELEASE_TYPE IS '能力注册方式[1=API直连,2=复合编排,3=协议转换,4=数据接口,9=专家模式]';
COMMENT ON COLUMN CONN_SERVICE.MOCK_URL IS 'MOCK服务URL';
COMMENT ON COLUMN CONN_SERVICE.MOCK_ENDPOINT IS 'MOCK服务ENDPOINT';
COMMENT ON COLUMN CONN_SERVICE.MOCK_SERVICE_NAME IS 'MOCK服务SERVICENAME';
COMMENT ON COLUMN CONN_SERVICE.MOCK_PORT_NAME IS 'MOCK服务PORTNAME';
COMMENT ON COLUMN CONN_SERVICE.MOCK_OPERATION IS 'MOCK服务METHOD';
COMMENT ON COLUMN CONN_SERVICE.LIMIT_CTRL_STATUS IS '限流开关[0=正常,2=停用]';
COMMENT ON COLUMN CONN_SERVICE.LIMIT_CTRL_TYPE IS '限流方式[1=QPS,2=线程数]';
COMMENT ON COLUMN CONN_SERVICE.LIMIT_CTRL_PARAMVAL IS '限流阀值';
COMMENT ON COLUMN CONN_SERVICE.ALARM_SECS IS '预警响应时间（秒）';
COMMENT ON COLUMN CONN_SERVICE.TIMEOUT_SECS IS '超时时间（秒）';
COMMENT ON COLUMN CONN_SERVICE.SERVICE_STATUS IS '服务状态[0=生效,1=暂存,2=停用,7=驳回,8=审批中,9=作废]';
COMMENT ON COLUMN CONN_SERVICE.SERVICE_MASTER_VERSION IS '服务主版本';
COMMENT ON COLUMN CONN_SERVICE.DELETE_FLAG IS '是否删除[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_SERVICE.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_SERVICE.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_SERVICE.UPDATE_TIME IS '更新时间';
COMMENT ON COLUMN CONN_SERVICE.ROUTE_CONTENT_ID IS '路由内容主键';

CREATE SEQUENCE SEQ_CONN_SERVICE_HEADER_IN START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_SERVICE_HEADER_IN (
    HEADER_ID NUMBER(19) NOT NULL, -- 请求头主键
    SERVICE_VER_ID NUMBER(19) NULL, -- 服务版本主键
    SERVICE_ID NUMBER(19) NULL, -- 服务ID
    SERVICE_VERSION NVARCHAR2(16) DEFAULT '', -- 服务版本
    NODE_TYPE NVARCHAR2(16) DEFAULT 'STRING' NOT NULL, -- 节点类型[STRING=字符串,LONG=整数,DECIMAL=小数]
    NODE_NAME NVARCHAR2(32) DEFAULT '' NOT NULL, -- 英文字段名
    NODE_LABEL NVARCHAR2(32) NULL, -- 字段中文描述
    NODE_NEEDEDABLE NVARCHAR2(100) DEFAULT 'Y' NOT NULL, -- 节点是否必填[Y=是,N=否]
    NODE_VALUEABLE NCHAR(1) DEFAULT 'Y' NOT NULL, -- 节点是否必填[Y=是,N=否]
    NODE_CHECK_REGEX NVARCHAR2(128) DEFAULT '', -- 字段值校验正则表达式
    NODE_DATA NCLOB NULL,
    CREATE_BY NVARCHAR2(64) DEFAULT '', -- 创建者
    CREATE_TIME TIMESTAMP(6) NULL, -- 创建时间
    UPDATE_BY NVARCHAR2(64) DEFAULT '', -- 更新者
    UPDATE_TIME TIMESTAMP(6) NULL, -- 更新时间
    CONSTRAINT CONN_SERVICE_HEADER_IN_PKEY PRIMARY KEY (HEADER_ID)
);
COMMENT ON TABLE CONN_SERVICE_HEADER_IN IS '能力服务请求头';

COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.HEADER_ID IS '请求头主键';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.SERVICE_ID IS '服务ID';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.SERVICE_VERSION IS '服务版本';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.NODE_TYPE IS '节点类型[STRING=字符串,LONG=整数,DECIMAL=小数]';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.NODE_NAME IS '英文字段名';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.NODE_LABEL IS '字段中文描述';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.NODE_NEEDEDABLE IS '节点是否必填[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.NODE_VALUEABLE IS '节点是否必填[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.NODE_CHECK_REGEX IS '字段值校验正则表达式';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.NODE_DATA IS '测试值';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_SERVICE_HEADER_IN.UPDATE_TIME IS '更新时间';

CREATE SEQUENCE SEQ_CONN_SERVICE_HEADER_OUT START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_SERVICE_HEADER_OUT (
    HEADER_ID NUMBER(19) NOT NULL, -- 响应头主键
    SERVICE_VER_ID NUMBER(19) NULL, -- 服务版本主键
    SERVICE_ID NUMBER(19) NOT NULL, -- 服务ID
    SERVICE_VERSION NVARCHAR2(16) DEFAULT '', -- 服务版本
    NODE_TYPE NVARCHAR2(16) DEFAULT 'STRING' NOT NULL, -- 节点类型[STRING=字符串,LONG=整数,DECIMAL=小数]
    NODE_NAME NVARCHAR2(32) DEFAULT '' NOT NULL, -- 英文字段名
    NODE_LABEL NVARCHAR2(32) NULL, -- 字段中文描述
    NODE_NEEDEDABLE NVARCHAR2(100) DEFAULT 'Y' NOT NULL, -- 节点是否必填[Y=是,N=否]
    CREATE_BY NVARCHAR2(64) DEFAULT '', -- 创建者
    CREATE_TIME TIMESTAMP(6) NULL, -- 创建时间
    UPDATE_BY NVARCHAR2(64) DEFAULT '', -- 更新者
    UPDATE_TIME TIMESTAMP(6) NULL, -- 更新时间
    CONSTRAINT CONN_SERVICE_HEADER_OUT_PKEY PRIMARY KEY (HEADER_ID)
);
COMMENT ON TABLE CONN_SERVICE_HEADER_OUT IS '能力服务响应头';

COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.HEADER_ID IS '响应头主键';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.SERVICE_ID IS '服务ID';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.SERVICE_VERSION IS '服务版本';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.NODE_TYPE IS '节点类型[STRING=字符串,LONG=整数,DECIMAL=小数]';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.NODE_NAME IS '英文字段名';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.NODE_LABEL IS '字段中文描述';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.NODE_NEEDEDABLE IS '节点是否必填[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_SERVICE_HEADER_OUT.UPDATE_TIME IS '更新时间';

CREATE SEQUENCE SEQ_CONN_SERVICE_PARAM_IN START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_SERVICE_PARAM_IN (
    NODE_ID NUMBER(19) NOT NULL, -- 节点ID
    SERVICE_VER_ID NUMBER(19) NULL, -- 服务版本主键
    SERVICE_ID NUMBER(19) NOT NULL, -- 服务ID
    SERVICE_VERSION NVARCHAR2(16) DEFAULT '', -- 服务版本
    NODE_PARENT_ID NUMBER(19) NOT NULL, -- 父节点ID
    NODE_TYPE NVARCHAR2(8) DEFAULT 'STRING' NOT NULL, -- 节点类型[STRING=字符串,LONG=整数,DECIMAL=小数,OBJECT=对象,ARRAY=数组]
    NODE_NAME NVARCHAR2(32) DEFAULT '' NOT NULL, -- 英文字段名
    NODE_LABEL NVARCHAR2(32) NULL, -- 字段中文描述
    NODE_NEEDEDABLE NCHAR(1) DEFAULT 'Y' NOT NULL, -- 节点是否必须[Y=是,N=否]
    NODE_VALUEABLE NCHAR(1) DEFAULT 'Y' NOT NULL, -- 节点是否必填[Y=是,N=否]
    NODE_CHECK_REGEX NVARCHAR2(128) DEFAULT '', -- 字段值校验正则表达式
    IS_ATTR NCHAR(1) DEFAULT 'N' NULL, -- 节点是否属性[Y=是,N=否]
    CREATE_BY NVARCHAR2(64) DEFAULT '', -- 创建者
    CREATE_TIME TIMESTAMP(6) NULL, -- 创建时间
    UPDATE_BY NVARCHAR2(64) DEFAULT '', -- 更新者
    UPDATE_TIME TIMESTAMP(6) NULL, -- 更新时间
    CONSTRAINT CONN_SERVICE_PARAM_IN_PKEY PRIMARY KEY (NODE_ID)
);
COMMENT ON TABLE CONN_SERVICE_PARAM_IN IS '能力服务入参';

COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.NODE_ID IS '节点ID';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.SERVICE_ID IS '服务ID';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.SERVICE_VERSION IS '服务版本';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.NODE_PARENT_ID IS '父节点ID';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.NODE_TYPE IS '节点类型[STRING=字符串,LONG=整数,DECIMAL=小数,OBJECT=对象,ARRAY=数组]';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.NODE_NAME IS '英文字段名';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.NODE_LABEL IS '字段中文描述';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.NODE_NEEDEDABLE IS '节点是否必须[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.NODE_VALUEABLE IS '节点是否必填[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.NODE_CHECK_REGEX IS '字段值校验正则表达式';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.IS_ATTR IS '节点是否属性[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_SERVICE_PARAM_IN.UPDATE_TIME IS '更新时间';

CREATE SEQUENCE SEQ_CONN_SERVICE_PARAM_OUT START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_SERVICE_PARAM_OUT (
    NODE_ID NUMBER(19) NOT NULL, -- 节点ID
    SERVICE_VER_ID NUMBER(19) NULL, -- 服务版本主键
    SERVICE_ID NUMBER(19) NOT NULL, -- 服务ID
    SERVICE_VERSION NVARCHAR2(16) DEFAULT '', -- 服务版本
    NODE_PARENT_ID NUMBER(19) NOT NULL, -- 父节点ID
    NODE_TYPE NVARCHAR2(8) DEFAULT 'STRING' NOT NULL, -- 节点类型[STRING=字符串,LONG=整数,DECIMAL=小数,OBJECT=对象,ARRAY=数组]
    NODE_NAME NVARCHAR2(32) DEFAULT '' NOT NULL, -- 英文字段名
    NODE_LABEL NVARCHAR2(32) NULL, -- 字段中文描述
    NODE_NEEDEDABLE NCHAR(1) DEFAULT 'Y' NOT NULL, -- 节点是否必须[Y=是,N=否]
    IS_ATTR NCHAR(1) DEFAULT 'N' NULL, -- 节点是否属性[Y=是,N=否]
    CREATE_BY NVARCHAR2(64) DEFAULT '', -- 创建者
    CREATE_TIME TIMESTAMP(6) NULL, -- 创建时间
    UPDATE_BY NVARCHAR2(64) DEFAULT '', -- 更新者
    UPDATE_TIME TIMESTAMP(6) NULL, -- 更新时间
    CONSTRAINT CONN_SERVICE_PARAM_OUT_PKEY PRIMARY KEY (NODE_ID)
);
COMMENT ON TABLE CONN_SERVICE_PARAM_OUT IS '能力服务出参';

COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.NODE_ID IS '节点ID';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.SERVICE_ID IS '服务ID';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.SERVICE_VERSION IS '服务版本';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.NODE_PARENT_ID IS '父节点ID';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.NODE_TYPE IS '节点类型[STRING=字符串,LONG=整数,DECIMAL=小数,OBJECT=对象,ARRAY=数组]';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.NODE_NAME IS '英文字段名';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.NODE_LABEL IS '字段中文描述';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.NODE_NEEDEDABLE IS '节点是否必须[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.IS_ATTR IS '节点是否属性[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_SERVICE_PARAM_OUT.UPDATE_TIME IS '更新时间';

CREATE SEQUENCE SEQ_CONN_SERVICE_VERSION START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_SERVICE_VERSION (
    SERVICE_VER_ID NUMBER(19) NOT NULL, -- 服务版本主键
    SERVICE_ID NUMBER(19) NOT NULL, -- 服务ID
    SERVICE_VERSION NVARCHAR2(16) DEFAULT '', -- 服务版本
    SERVICE_VER_DESC NVARCHAR2(512) DEFAULT '', -- 服务版本说明
    SERVICE_VER_STATUS NCHAR(1) DEFAULT '1' NULL, -- 服务状态[0=生效,1=暂存,2=停用,7=驳回,8=审批中,9=作废]
    SERVICEI_VER_START_TIME TIMESTAMP(6) NULL, -- 版本启用时间
    SERVICE_VER_END_TIME TIMESTAMP(6) NULL, -- 版本停用时间（根据启停时间定时更新版本状态）
    WSDL_CONTENT_ID NUMBER(19) NULL, -- WSDL内容主键
    WSDL_URL NVARCHAR2(512) NULL, -- WSDL地址（主版本同时发布带版本号和不带版本号的两个服务URL）
    JMS_DATASOURCE_CODE NVARCHAR2(32) DEFAULT '', -- JMS数据源编码
    JMS_TYPE NVARCHAR2(16) DEFAULT '', -- JMS类型[TOPIC=TOPIC,QUEUE=QUEUE]
    JMS_DESTINATION_NAME NVARCHAR2(64) DEFAULT '', -- JMS消息目标名称
    JMS_ROLE NCHAR(1) DEFAULT 'C' NULL, -- JMS角色[P=生产者,C=消费者]
    CREATE_BY NVARCHAR2(64) DEFAULT '', -- 创建者
    CREATE_TIME TIMESTAMP(6) NULL, -- 创建时间
    UPDATE_BY NVARCHAR2(64) DEFAULT '', -- 更新者
    UPDATE_TIME TIMESTAMP(6) NULL, -- 更新时间
    HTTP_REQUEST_METHOD NVARCHAR2(8) NULL, -- 请求方式
    ROUTE_CONTENT_ID NUMBER(19) NULL, -- 路由内容主键
    INPARAM_WITH_ATTR NCHAR(1) DEFAULT 'N' NOT NULL, -- 带属性入参[Y=是,N=否]
    OUTPARAM_WITH_ATTR NCHAR(1) DEFAULT 'N' NOT NULL, -- 带属性出参[Y=是,N=否]
    TEST_PASS_STATUS NCHAR(1) NULL, -- 测试通过状态[0=未通过,1=通过]
    PERM_TYPE NVARCHAR2(255) NULL,
    CONSTRAINT CONN_SERVICE_VERSION_PKEY PRIMARY KEY (SERVICE_VER_ID)
);
CREATE INDEX IDX_SERVICE_ID ON CONN_SERVICE_VERSION(SERVICE_ID);
COMMENT ON TABLE CONN_SERVICE_VERSION IS '能力服务版本';

COMMENT ON COLUMN CONN_SERVICE_VERSION.SERVICE_VER_ID IS '服务版本主键';
COMMENT ON COLUMN CONN_SERVICE_VERSION.SERVICE_ID IS '服务ID';
COMMENT ON COLUMN CONN_SERVICE_VERSION.SERVICE_VERSION IS '服务版本';
COMMENT ON COLUMN CONN_SERVICE_VERSION.SERVICE_VER_DESC IS '服务版本说明';
COMMENT ON COLUMN CONN_SERVICE_VERSION.SERVICE_VER_STATUS IS '服务状态[0=生效,1=暂存,2=停用,7=驳回,8=审批中,9=作废]';
COMMENT ON COLUMN CONN_SERVICE_VERSION.SERVICEI_VER_START_TIME IS '版本启用时间';
COMMENT ON COLUMN CONN_SERVICE_VERSION.SERVICE_VER_END_TIME IS '版本停用时间（根据启停时间定时更新版本状态）';
COMMENT ON COLUMN CONN_SERVICE_VERSION.WSDL_CONTENT_ID IS 'WSDL内容主键';
COMMENT ON COLUMN CONN_SERVICE_VERSION.WSDL_URL IS 'WSDL地址（主版本同时发布带版本号和不带版本号的两个服务URL）';
COMMENT ON COLUMN CONN_SERVICE_VERSION.JMS_DATASOURCE_CODE IS 'JMS数据源编码';
COMMENT ON COLUMN CONN_SERVICE_VERSION.JMS_TYPE IS 'JMS类型[TOPIC=TOPIC,QUEUE=QUEUE]';
COMMENT ON COLUMN CONN_SERVICE_VERSION.JMS_DESTINATION_NAME IS 'JMS消息目标名称';
COMMENT ON COLUMN CONN_SERVICE_VERSION.JMS_ROLE IS 'JMS角色[P=生产者,C=消费者]';
COMMENT ON COLUMN CONN_SERVICE_VERSION.CREATE_BY IS '创建者';
COMMENT ON COLUMN CONN_SERVICE_VERSION.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN CONN_SERVICE_VERSION.UPDATE_BY IS '更新者';
COMMENT ON COLUMN CONN_SERVICE_VERSION.UPDATE_TIME IS '更新时间';
COMMENT ON COLUMN CONN_SERVICE_VERSION.HTTP_REQUEST_METHOD IS '请求方式';
COMMENT ON COLUMN CONN_SERVICE_VERSION.ROUTE_CONTENT_ID IS '路由内容主键';
COMMENT ON COLUMN CONN_SERVICE_VERSION.INPARAM_WITH_ATTR IS '带属性入参[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_VERSION.OUTPARAM_WITH_ATTR IS '带属性出参[Y=是,N=否]';
COMMENT ON COLUMN CONN_SERVICE_VERSION.TEST_PASS_STATUS IS '测试通过状态[0=未通过,1=通过]';

CREATE SEQUENCE SEQ_CONN_SORTH_INTF_LOG START WITH 1000000 INCREMENT BY 1 NOCACHE;

CREATE TABLE CONN_SORTH_INTF_LOG (
    SORTH_INTF_LOG_ID NUMBER(19) NOT NULL, -- 主键ID
    SERVICE_CODE NVARCHAR2(64) NULL, -- 接口编码
    BIZ_CODE NVARCHAR2(64) NULL, -- 业务编码
    SORTH_IN_PARAMS NCLOB NULL, -- 南向上传接口发送的参数
    OUT_XML_PARAMS NCLOB NULL, -- 开放互联消费者根据规则转成XML的参数
    XML_TO_JSON NCLOB NULL, -- 转换后的XML 转成 JSON，作为 DCOOS 接口的 入参
    DCOOS_RETRUN_MSG NCLOB NULL, -- DCOOS 接口返回的信息
    JSON_TO_XML NCLOB NULL, -- DCOOS 返回的JSON  根据规则 转 XML
    INVOKE_DCOOS_TIME TIMESTAMP(6) NULL, -- 调用DCOOS时间
    ERROR_MSG NCLOB NULL, -- 错误信息
    STATUS NCHAR(1) NULL, -- 状态[1=成功,2=失败]
    CONSTRAINT CONN_SORTH_INTF_LOG_PKEY PRIMARY KEY (SORTH_INTF_LOG_ID)
);
COMMENT ON TABLE CONN_SORTH_INTF_LOG IS '南向上传：接口日志表';

COMMENT ON COLUMN CONN_SORTH_INTF_LOG.SORTH_INTF_LOG_ID IS '主键ID';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.SERVICE_CODE IS '接口编码';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.BIZ_CODE IS '业务编码';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.SORTH_IN_PARAMS IS '南向上传接口发送的参数';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.OUT_XML_PARAMS IS '开放互联消费者根据规则转成XML的参数';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.XML_TO_JSON IS '转换后的XML 转成 JSON，作为 DCOOS 接口的 入参';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.DCOOS_RETRUN_MSG IS 'DCOOS 接口返回的信息';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.JSON_TO_XML IS 'DCOOS 返回的JSON  根据规则 转 XML';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.INVOKE_DCOOS_TIME IS '调用DCOOS时间';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.ERROR_MSG IS '错误信息';
COMMENT ON COLUMN CONN_SORTH_INTF_LOG.STATUS IS '状态[1=成功,2=失败]';